package com.woniuxy.controller;

import com.woniuxy.anno.PreAuthorize;
import com.woniuxy.entity.Menu;
import com.woniuxy.service.MenuService;
import com.woniuxy.util.ResponseData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/menu")
public class MenuController {
    @Resource
    private MenuService menuService;
    @GetMapping("/queryUserMenu")
    public ResponseData<?> queryUserMenu(){
        List<Menu> menus = menuService.queryUserMenu(1);
        return new ResponseData<>().ok(menus);
    }
    @GetMapping("/update")
    @PreAuthorize(value = {"updateMenu","update"})//添加权限控制
    public ResponseData<?> update(){
        //List<Menu> menus = menuService.update();
        return new ResponseData<>().ok();

    }
}
